package com.yyw.rabbitmq.api;

import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

@Data
@Builder
@EqualsAndHashCode
public class Message implements Serializable {
    private static final long serialVersionUID = -2083503801443301445L;

    /*  消息唯一ID  */
    private String messageId;

    /*  消息主题    */
    private String topic;

    /*  路由键     */
    private String routeKey;

    /*  消息附加属性  */
    private Map<String, Object> attr = new HashMap<>();

    /*  延时消息的延迟时间，默认不是延迟消息就是 0  */
    private int delayed;

    /*  消息类型    */
    private String messageType = MessageType.CONFIRM;
}
